package com.bite.java_chatroom.controller;

import com.bite.java_chatroom.model.Message;
import com.bite.java_chatroom.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/message")
public class MessageController {
    @Autowired
    private MessageService messageService;

    @ResponseBody
    @RequestMapping("/getmessageList")
    public List<Message> getMessageList(Integer sessionId){
        return messageService.getMessageListBySessionId(sessionId);
    }
}





